package com.ysd.ziyuanshiyongtongji.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.data.annotation.CreatedDate;

import lombok.Data;

/**
 * Statistics
 */
@Data
@Entity
@Table
public class Statistics {
    //每天每个资源室插入当天使用人次
    //（通过数据库的计划任务完成，也可以通过任务调度完成）
    @Id//主键
    @GeneratedValue(strategy=GenerationType.IDENTITY)//自增
    private Integer id;//主键
    @ManyToOne(targetEntity = ReadRoom.class)
    private ReadRoom readRoom;
    @CreatedDate
    private Date day;
    private Integer num;//使用人次
}